<fieldset id='product_edit'>
<legend>Product: "<?php echo $this->productModel->model;?>"</legend>
<table id='product_photos_table'>
<th>images</th>
<?php foreach ($this->imageLinks as $link):?>
	<tr>
	<td><img src='<?php echo $this->BaseUrl()."/images/products/".$link->link;?>'/></td>
	</tr>
<?php endforeach;?>
</table>
<?php echo $this->form ?>
<?php echo $this->headLink()->prependStylesheet($this->baseUrl().'/javascript/Calendar/stylesheet/main.css'); ?>
<div id ='calendar'></div>
</fieldset>
<?php echo $this->InlineScript()->appendFile($this->baseUrl().'/javascript/Calendar/js/Handler.js'); ?>
<?php echo $this->InlineScript()->appendFile($this->baseUrl().'/javascript/Calendar/js/Document.js'); ?>
<?php echo $this->InlineScript()->appendFile($this->baseUrl().'/javascript/Calendar/js/Calendar.js'); ?>


<script>
$(function(){
	var date_info_input = document.getElementsByName('date_info_input')[0];
	$('#cal_tab td').live('click',function(){
		var dateText = $('#date_info_input').text();
		$('#date').val(dateText);
	});
	var dateInfo = date_info_input.innerHTML;

	$('#date').bind({
		'click': function(e){

				this.innerHTML = dateInfo;
				var e = e || event.widow;
				var x = e.pageX;
				var y = e.pageY;
				$('#calendar').css({
					'left':x + 'px',
					'top' :y  + 'px'
				}).toggle(200);
			}
	});

});
</script>